﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using KPIS.GERP.SECURITY.DAL;
using KPIS.GERP.SECURITY.MODEL;

namespace KPIS.GERP.SECURITY.BLL
{
    public class UserBLL
    {
        private UserDAL DAL = new UserDAL();

        public UserBLL()
        {

        }
        public DataSet LoadUser(Nullable<int> Sequence, Nullable<int> EmployeeType, Nullable<int> RoleSequence, string SearchText)
        {
            return DAL.LoadUser(Sequence, EmployeeType, RoleSequence, SearchText);
        }
        public DataSet LoadUserRole(Nullable<int> Sequence, Nullable<int> EmployeeType, Nullable<int> RoleSequence, string SearchText)
        {
            return DAL.LoadUserRole(Sequence, EmployeeType, RoleSequence, SearchText);
        }
        public bool CheckPassword(string UserName, string Password)
        {
            return DAL.CheckPassword(UserName, Password);
        }
        public void Insert(Nullable<int> EmpSequence, string UserID, string Password, string UserStatus, int CreatedBy)
        {
            try
            {
                DAL.Insert(EmpSequence, UserID, Password, UserStatus, CreatedBy);
            }
            catch
            {
                throw;
            }
        }
        public void Update(int Sequence, Nullable<int> EmpSequence, string UserID, string Password, string UserStatus
           , int UpdatedBy)
        {
            try
            {
                DAL.Update(Sequence, EmpSequence, UserID, Password, UserStatus, UpdatedBy);
            }
            catch
            {
                throw;
            }
        }
        public void Delete(int Sequence, int UpdatedBy)
        {
            try
            {
                DAL.Delete(Sequence, UpdatedBy);
            }
            catch
            {
                throw;
            }
        }
    }
}
